package router

import (
	"github.com/gin-gonic/gin"
	jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
	"tuowei.com/app/admin/apis"
	"tuowei.com/common/actions"
)

func init() {
	routerCheckRole = append(routerCheckRole, sysSubjectRouter)
}

// 需认证的路由代码
func sysSubjectRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.SysSubject{}
	r := v1.Group("/sys-subject").Use(authMiddleware.MiddlewareFunc()).Use(actions.PermissionAction())
	{
		r.GET("", api.GetPage)
		r.GET("/list", api.GetSubjectList)
		r.GET("/:id", api.Get)
		r.POST("", api.Insert)
		r.PUT("", api.Update)
		r.DELETE("", api.Delete)
		r.DELETE("/knowledge-point/:id", api.DeleteKnowledgePoint)
		r.POST("/knowledge-point/add", api.CreateKnowledgePoint)
	}

}
